<%@ Control Language="C#" AutoEventWireup="true" Inherits="CMS.Web.UI.UserControls.PageEditor" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajax" %>
<%@ Register Assembly="FredCK.FCKeditorV2" Namespace="FredCK.FCKeditorV2" TagPrefix="fck" %>

<table>
    <tr>
        <td valign="top" style="width:200px;">
            <asp:Repeater runat="server" ID="repeaterPage">
                <HeaderTemplate>
                    <table>
                </HeaderTemplate>
                <ItemTemplate>
                    <tr>
                        <td><a href="?Page=<%= Page.PageID %>&PageID=<%# Eval("PageID") %>"><img src="/Pics/CMS/Edit.png" alt="Edit" /></a></td>
                        <td><%# Eval("PageName") %></td>
                        <td><a href="?Page=<%= Page.PageID %>&Delete=<%# Eval("PageID") %>"><img src="/Pics/CMS/Delete.png" alt="X" /></a></td>
                    </tr>
                </ItemTemplate>
                <FooterTemplate>
                    </table>
                </FooterTemplate>
            </asp:Repeater>
        </td>
        <td valign="top"style="width:550px;">
            <table>
                <tr>
                    <td><asp:Label runat="server" ID="lTitle" Text="Title" /></td>
                    <td><asp:TextBox runat="server" ID="tbTitle" /></td>
                </tr>
                <tr>
                    <td><asp:Label runat="server" ID="lName" Text="Name" /></td>
                    <td><asp:TextBox runat="server" ID="tbName" /></td>
                </tr>
                <tr>
                    <td><asp:Label runat="server" ID="lMasterPage" Text="Master Page" /></td>
                    <td><asp:TextBox runat="server" ID="tbMasterPage" /></td>
                </tr>
                <tr>
                    <td><asp:Label runat="server" ID="lRequireAuthentication" Text="Require Authentication" /></td>
                    <td><asp:CheckBox runat="server" ID="cbRequireAuthentication" /></td>
                </tr>
                <tr>
                    <td><asp:Label runat="server" ID="lParent" Text="Parent" /></td>
                    <td><asp:DropDownList runat="server" ID="ddlParent" /></td>
                </tr>
                <tr>
                    <td colspan="2"><asp:Button runat="server" ID="bValidate" Text="Validate" /></td>
                </tr>
            </table>
            <asp:PlaceHolder ID="phPageEditor" runat="server">
                <asp:UpdatePanel ID="upReorderChildren" runat="server" ChildrenAsTriggers="true">
                    <ContentTemplate>
                        <ajax:ReorderList ID="rlChildren" runat="server" PostBackOnReorder="true" >
                            <ItemTemplate>
                                <%# Eval("PageName") %>
                            </ItemTemplate>
                        </ajax:ReorderList>
                    </ContentTemplate>
                </asp:UpdatePanel>
                <asp:UpdatePanel runat="server" ID="upPageEditorRoles" ChildrenAsTriggers="true">
                    <ContentTemplate>
                        <table>
                            <tr>
                                <td><asp:DropDownList runat="server" ID="ddlRoles" /></td>
                                <td><asp:Button runat="server" ID="bAddRole" Text="Add Role" /></td>
                            </tr>
                            <tr>
                                <td colspan="2"><asp:ListBox runat="server" ID="lbRoles" /></td>
                            </tr>
                            <tr>
                                <td colspan="2"><asp:Button runat="server" ID="bRemoveRole" Text="Remove Role" /></td>
                            </tr>
                        </table>
                    </ContentTemplate>
                </asp:UpdatePanel>
                <asp:UpdatePanel ID="upPageEditorContent" runat="server" ChildrenAsTriggers="true">
                    <ContentTemplate>
                        <asp:DropDownList ID="ddlCulture" runat="server" AutoPostBack="true" />
                        <asp:LinkButton ID="lbCreateContent" runat="server" Text = "Create Content for this Culture"/>
                        <fck:FCKeditor ID="wysiwygEditor" runat="server" Height="600" ToolbarSet="Full" />
                        <asp:Button ID="bValidateContent" runat="server" Text="Save Content" />
                    </ContentTemplate>
                </asp:UpdatePanel>
                <asp:UpdatePanel ID="upPageEditorControl" runat="server" ChildrenAsTriggers="true">
                    <ContentTemplate>
                        <asp:Repeater ID="repeaterControl" runat="server">
                            <HeaderTemplate>
                                <table>
                            </HeaderTemplate>
                            <ItemTemplate>
                                <tr>
                                    <td><a href="?Page=<%= Page.PageID %>&PageID=<%= Request.QueryString["PageID"] %>&ControlID=<%# Eval("ControlID") %>"><img src="/Pics/CMS/Edit.png" alt="Edit" /></a></td>
                                    <td><%# Eval("ControlPath") %></td>
                                    <td><a href="?Page=<%= Page.PageID %>&PageID=<%= Request.QueryString["PageID"] %>&DeleteControl=<%# Eval("ControlID") %>"><img src="/Pics/CMS/Delete.png" alt="X" /></a></td>
                                </tr>
                            </ItemTemplate>
                            <FooterTemplate>
                                </table>
                            </FooterTemplate>
                        </asp:Repeater>
                        <asp:TextBox ID="tbControlPath" runat="server" />
                        <asp:Button ID="bAddControl" runat="server" Text="Create Control" />
                    </ContentTemplate>
                </asp:UpdatePanel>
            </asp:PlaceHolder>
        </td>
    </tr>
</table>
